package com.yym.sina.weibo;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

public class WeiboConfigLoader {

	private static WeiboConfigLoader instance = new WeiboConfigLoader();
	private Properties propertie;
	
	private WeiboConfigLoader()
	{
		propertie = new Properties(); 
		
		try {
			//URL path = this.getClass().getClassLoader().getResource("weiboConfig.properties"); 
			//InputStream ins = new FileInputStream(new File(path.getFile()));			
			//propertie.load(ins);			
			propertie.load(getClass().getResourceAsStream("/weiboConfig.properties"));			
		} catch (IOException e) {			
			e.printStackTrace();
		} 
	}
	
	public static WeiboConfigLoader getInstance()
	{
		return instance;
	}
	
	public String getValue(String key)
	{
		return propertie.getProperty(key);
	}
	
	
}
